<%@ Language=VBScript %>
<%Option Explicit%>
<%
Response.Expires=0

'if Session("UserName") = "" then
'	response.Redirect "Login.asp"
'end if
%>

<!--#include file="../cons.asp"-->
<!--#include file="../../Common/Database.asp"-->

<script src="../../js/prototype.js" type="text/javascript"></script>

<style type='text/css'>
	.pullDownTable{border-collapse: collapse; width:130px; background-color:#E7E7C5;}
	.pullDownTD{cursor: hand; width:130px; height:20px; border:1px solid #adadad;font:normal 11px Verdana;color:#666666;}
	.pullDownTDSS1{cursor: hand; width:120px; height:20px; border-left: 1px solid #adadad; border-top: 1px solid #adadad; border-bottom: 1px solid #adadad; font:normal 11px Verdana;color:#666666;}
	.pullDownTDSS2{cursor: hand; width:10px; height:20px; border-top: 1px solid #adadad; border-right: 1px solid #adadad; border-bottom: 1px solid #adadad; font:normal 11px Verdana;color:#666666;}
</style>

<html>
<body bgcolor="#d4d4c0" style="margin: 0px;">
<center>
<br>
<table cellpadding="0" cellspacing="0" width=95% style="border-collapse: collapse; font-family: Verdana; font-size: 0px;">
<tr>
	<td style="background-image: url(../../images/sup_izq.gif); background-repeat: no-repeat; width: 12px; height: 12px;"></td>
	<td style="border-top: solid 1px #909090; background-color: #FCFCE4;">&nbsp;</td>
	<td style="background-image: url(../../images/sup_der.gif); background-repeat: no-repeat; width: 12px; height: 12px;"></td>
</tr>
<tr>
	<td style="border-left: solid 1px #909090; background-color: #FCFCE4;" height=50>&nbsp;</td>
	<td style="background-color: #FCFCE4;">
		<table cellpadding="0" cellspacing="0" width=100% height=100% style="border-collapse: collapse; font-family: Verdana; font-size: 12px;">
			<tr>
				<td valign="top" style="font-weight: bold;">Curso:</td>
				<td valign="top" style="font-weight: bold;">Tipo:</td>
				<td valign="top" style="font-weight: bold;">Quincenas:</td>
			</tr>
			<tr>
				<td valign="top"><%=GetComboCursos()%></td>
				<td valign="top"><%=GetComboFirma()%></div></td>
				<td valign="top"><%=GetComboQuincenas()%></td>
			</tr>
		</table>
	</td>
	<td style="border-right: solid 1px #909090; background-color: #FCFCE4;">&nbsp;</td>
</tr>
<tr>
	<td style="background-image: url(../../images/inf_izq.gif); background-repeat: no-repeat; width: 12px; height: 12px;"></td>
	<td style="border-bottom: solid 1px #909090; background-color: #FCFCE4;">&nbsp;</td>
	<td style="background-image: url(../../images/inf_der.gif); background-repeat: no-repeat; width: 12px; height: 12px;"></td>
</tr>
</table>
<br>
<table cellpadding="0" cellspacing="0" width=50% style="border-collapse: collapse; font-family: Verdana; font-size: 0px;">
<tr>
	<td width="100%" valign="top" align="center">
		<table cellpadding="0" cellspacing="0" width=90% style="border-collapse: collapse; font-family: Verdana; font-size: 0px;" ID="Table1">
		<tr>
			<td style="background-image: url(../../images/sup_izq.gif); background-repeat: no-repeat; width: 12px; height: 12px;"></td>
			<td style="border-top: solid 1px #909090; background-color: #FCFCE4;">&nbsp;</td>
			<td style="background-image: url(../../images/sup_der.gif); background-repeat: no-repeat; width: 12px; height: 12px;"></td>
		</tr>
		<tr>
			<td style="border-left: solid 1px #909090; background-color: #FCFCE4;" height=50>&nbsp;</td>
			<td style="background-color: #FCFCE4;">
				<table cellpadding="0" cellspacing="0" width=100% height=100% style="border-collapse: collapse; font-family: Verdana; font-size: 12px;" ID="Table2">
					<tr>
						<td valign="top" style="font-weight: bold;">Listado de Alumnos</td>
					</tr>
					<tr>
						<td valign="top" align="center"><div id="divAlumnosFirmas" style="width: 400px; height: 200px;"></div></td>
					</tr>
				</table>
			</td>
			<td style="border-right: solid 1px #909090; background-color: #FCFCE4;">&nbsp;</td>
		</tr>
		<tr>
			<td style="background-image: url(../../images/inf_izq.gif); background-repeat: no-repeat; width: 12px; height: 12px;"></td>
			<td style="border-bottom: solid 1px #909090; background-color: #FCFCE4;">&nbsp;</td>
			<td style="background-image: url(../../images/inf_der.gif); background-repeat: no-repeat; width: 12px; height: 12px;"></td>
		</tr>
		</table>
	</td>
</tr>
</table>
<%
Private function GetComboCursos()

	Dim oConn, sSQL, oRS
	Dim count	' para saber si es la primera vez que entra al while
	
	Set oConn = OpenConnection
	
	sSQL = "select * from Curso order by CursoDescrip"
	
	Set oRS = oConn.Execute(sSQL)

	response.Write "<select id=""cmb_Cursos"" style=""font-family: Verdana; font-size: 10px;"" onchange=""GetAlumnosxFirmas(this.value, cmb_FnoF.value, cmb_Quincenas.value);"">"
	while not oRS.EOF
		response.Write "<option "
		if count=0 then
			response.Write "selected"
			count=1
		end if
		response.Write " value='" & oRS("IdCurso") & "'>"
		response.Write oRS("CursoDescrip")
		response.Write "</option>"
		oRS.MoveNext()
	wend
	response.Write "</select>"
End function

Private function GetComboQuincenas()
	Dim oConn, sSQL, oRS
	Dim count	' para saber si es la primera vez que entra al while
	
	Set oConn = OpenConnection
	
	sSQL = "select * from ColegioQuincena"
	
	Set oRS = oConn.Execute(sSQL)

	response.Write "<select id=""cmb_Quincenas"" style=""font-family: Verdana; font-size: 10px;"" onchange=""GetAlumnosxFirmas(cmb_Cursos.value, cmb_FnoF.value, this.value);"">"
	while not oRS.EOF
		response.Write "<option "
		if count=0 then
			response.Write "selected"
			count=1
		end if
		response.Write " value='" & oRS("IdColegioQuincena") & "'>"
		response.Write "Trimestre " & oRS("Trimestre") & "|Quincena " & oRS("IdQuincena") & " (" & oRS("FechaDesde") & " - " & oRS("FechaHasta") & ")"
		response.Write "</option>"
		oRS.MoveNext()
	wend
	response.Write "</select>"
End function

Private function GetComboFirma()
	response.Write "<select id=""cmb_FnoF"" style=""font-family: Verdana; font-size: 10px;"" onchange=""GetAlumnosxFirmas(cmb_Cursos.value, this.value, cmb_Quincenas.value);"">"
	response.Write "<option value='2'>TODAS</option>"
	response.Write "<option selected value='0'>Sin Firmar</option>"
	response.Write "<option value='1'>Firmadas</option>"
	response.Write "</select>"
End function

%>


<script>

function GetAlumnosxFirmas(IdCurso, FnoF, IdQuincena)
{
	new Ajax.Request('AJAX_GetAlumnosxFirmas.asp?IdCurso='+IdCurso+'&FnoF='+FnoF+'&IdQuincena='+IdQuincena,{
								method:'get',
								onSuccess:	function(transport)
											{
												//alert(transport.responseText);
												var response = transport.responseText || "no response text";       
												//alert("Success! \n\n" + response);
												divAlumnosFirmas.innerHTML = response;
											},
								onFailure: function()
											{
													alert('No hay datos...');
											}   
								}
					); 
}

GetAlumnosxFirmas(1, 0, 1);

function FirmarEnPantalla(idAlumno, idSedeCurso)
{
	window.open("FirmarEnPantalla_R.asp?idAlumno="+idAlumno+"&idSedeCurso="+idSedeCurso+"&CuyExtraCu=1", "EnPantalla", "top=0, left=0, width=1020, height=650, toolbar=1, scrollbars=1");
}

function PopupEvAlumno(idAlumno, idSedeCurso, IdMateria)
{
	window.open("PopupEvAlumno.asp?idAlumno="+idAlumno+"&idSedeCurso="+idSedeCurso+"&IdMateria="+IdMateria, "PopupEvAlumno", "top=0, left=0, width=600, height=400, toolbar=0");
}
</script>
</center>
</body>
</html>